package top.kaoshanji.p1ch08a;

/**
 * 代码清单-p1ch08a-172页a：使用继承构造太空船
 * author kaoshanji
 * ^_^
 * create time 2025/3/9 15:53
 */
public class DerivedSpaceShip extends SpaceShipControls {

    private String name;

    public DerivedSpaceShip(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    public static void main(String[] args) {
        DerivedSpaceShip protector = new DerivedSpaceShip("NSEA Protector");
        protector.forward(100);
    }

}
